// owner-app/pages/perfectInformation/index.js
import { handlerGobackClick } from "../../../utils/util";
const app = getApp();
Page({
  data: {
    baseImgUrl: "",
    listPerfect: [
      {
        image: "girlImg.png",
        identityName: "社区居民",
        explain: "长期居住在此的人",
        usertype: "Homeowner",
      },
      {
        image: "bodyImg.png",
        identityName: "租户",
        explain: "租住在这里的人群",
        usertype: "Household",
      },
    ],
    options: {},
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      options,
    });
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var { baseImgUrl } = getApp().globalImgUrl.config;
    this.setData({
      baseImgUrl,
    });
  },
  handlerGobackClick,
  // 选择身份
  handleridentity(e) {
    var { usertype } = e.currentTarget.dataset;
    var { address } = this.data.options;

    //添加住址
    if (address == 1) {
      wx.navigateTo({
        url: "/owner-app/pages/form-my-dwell/index?userType=" + usertype,
      });
      return;
    }

    // 居住信息--详情--添加住址
    if (address == 2) {
      wx.navigateTo({
        url:
          "/owner-app/pages/formresident-my-dwelldetail/index?userType=" +
          usertype,
      });
      return;
    }

    wx.navigateTo({
      url: "/owner-app/pages/complete-information/index?userType=" + usertype,
    });
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
});
